package xxx;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Animal {

    public static void main(String[] args) {
        List<Dog> list =new ArrayList<>();
        list.add(new Dog());
        list.add(new ChinesePastoralDog());
        int i = countGreaterThan(list);
        System.out.println("i = " + i);


    }
    // 方法的泛型
    public static  <T extends Dog> int countGreaterThan(List<T> array){
        int count = 0;
        for (int i = 0; i < array.size(); i++) {
            count ++;
        }
        return count;
    }


}

